package com.tj.bigdata.syncblock.config;

import com.tj.bigdata.syncblock.constant.KafkaConstant;
import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author guoch
 */
@Configuration
public class KafkaInitialConfiguration {

    @Bean
    public NewTopic blockTopic(){
        return new NewTopic(KafkaConstant.KAFKA_BLOCK_INFO,2,(short) 1);
    }

    @Bean
    public NewTopic transactionTopic(){
        return new NewTopic(KafkaConstant.KAFKA_TRANSACTION_TOPIC,2,(short) 1);
    }

    /**
     * 流处理shu
     * @return
     */
    @Bean
    public NewTopic transactionStreamSourceTopic(){
        return new NewTopic(KafkaConstant.KAFKA_TRANSACTION_STREAM_SOURCE_TOPIC,1,(short) 1);
    }
}
